#!/bin/bash

source /home/shell/util.sh



# 安装函数
function install () {
    printInfo "版本列表："
    curl -sL https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/|grep -Po "Anaconda.*?-Linux-x86_64.sh"
    while [ true ]; do
        read -p "选择版本：" version
        if [[ -z "${version}" ]]; then
            printFail "请重新输入版本！"
            continue;
        else
            break;
        fi
    done
    download /tmp/anaconda.sh https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/${version}
    bash /tmp/anaconda.sh
}

# 配置函数
function config(){
    source ~/.bashrc
}

function run () {
    echo 'run';
}

# 运行安装和配置
install && config